/**
 * PageMarket
 * FullQuotActivity.java
 * com.android.pagemarket.ui.activity.price
 * 
 */
package com.android.pagemarket.ui.activity.price;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.android.pagemarket.R;
import com.android.pagemarket.ui.activity.base.TemplateActivity;

/*********************************************************
 * @author : zhaohua
 * @version : 2012-11-28
 * @see : 查看完整报价
 * @Copyright : copyrights reserved by personal 2007-2012
 **********************************************************/
public class FullQuotActivity extends TemplateActivity
{        
    private String mUrl;
    
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        if(!handIntent())
        {
            finish();
            return;
        }
        setContentView(R.layout.activity_fullquot);
        
        WebView webView  = getViewById(R.id.webView);
        
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(webClient);
        webView.loadUrl(mUrl);
    }
    
    private WebViewClient webClient = new WebViewClient()
    {
        public void onPageStarted(WebView view, String url, android.graphics.Bitmap favicon) 
        {
            showLoading(true);
        };
        
        public void onPageFinished(WebView view, String url) 
        {
            showLoading(false);
        };
    };
    
    private boolean handIntent()
    {
        Intent it = getIntent();
        mUrl = it.getStringExtra(KEY_PARAM);
        return mUrl != null;
    }
    
    public static void startActivity(Context context,String url)
    {
        Intent it = new Intent(context, FullQuotActivity.class);
        it.putExtra(KEY_PARAM, url);
        context.startActivity(it);
    }
}
